<?php
namespace app\api\model;

use think\Model;
use think\Log;
use app\common\lib\exception\ApiException;
class Grade extends Model{
    /**
     * 获取年级信息
     * @author 王柯 <wangke.email@foxmail.com>
     * @return mixed
     */
    public function index(){
        try{
            $result = $this->select();
            return show(config('code.success'),'ok！',$result);
        }catch (\Exception $e){
            Log::write($e->getMessage());
            throw new ApiException($e->getMessage(),400);
        }
    }
}